package com.example.demo.app.service.impl;

import com.example.demo.app.repository.TeacherRepository;
import com.example.demo.app.service.TeacherService;
import com.example.demo.domain.entity.Teacher;
import com.example.demo.infra.mapper.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherRepository teacherRepository;

    @Override
    public Teacher queryTeacherById(Integer id) {
        return teacherRepository.queryTeacherById(id);
    }

    @Override
    public List<Teacher> queryTeacherList() {
        return teacherRepository.queryTeacherList();
    }

    @Override
    public Integer addTeacher(Teacher teacher) {
        return teacherRepository.addTeacher(teacher);
    }

    @Override
    public Integer saveTeacher(Teacher teacher) {
        return teacherRepository.addTeacher(teacher);
    }

    @Override
    public Integer deleteTeacherById(Integer id) {
        return teacherRepository.deleteTeacherById(id);
    }
}
